//  this library.
import 'package:hktk_app/model/industry/exam_model.dart';

/// 行业相关类
class IndustryModel {
  String? createdTime;
  String? modifyTime;
  String? createdBy;
  String? modifyBy;
  String? id;
  String? name;
  String? serverName;
  int? sort;
  String? icon;
  int? examCount;
  List<ExamModel>? exams;
  int? authFlag;
  String? keyword;
  String? code;

  IndustryModel({
    this.createdTime,
    this.modifyTime,
    this.createdBy,
    this.modifyBy,
    this.id,
    this.name,
    this.serverName,
    this.sort,
    this.icon,
    this.examCount,
    this.exams,
    this.authFlag,
    this.keyword,
    this.code,
  });

  IndustryModel.fromJson(Map<String, dynamic> json) {
    createdTime = json['createdTime'];
    modifyTime = json['modifyTime'];
    createdBy = json['createdBy'];
    modifyBy = json['modifyBy'];
    id = json['id'];
    name = json['name'];
    serverName = json['serverName'];
    sort = json['sort'];
    icon = json['icon'];
    examCount = json['examCount'];
    if (json['exams'] != null) {
      exams = <ExamModel>[];
      json['exams'].forEach((v) {
        exams!.add(ExamModel.fromJson(v));
      });
    }
    authFlag = json['authFlag'];
    keyword = json['keyword'];
    code = json['code'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = <String, dynamic>{};
    data['createdTime'] = createdTime;
    data['modifyTime'] = modifyTime;
    data['createdBy'] = createdBy;
    data['modifyBy'] = modifyBy;
    data['id'] = id;
    data['name'] = name;
    data['serverName'] = serverName;
    data['sort'] = sort;
    data['icon'] = icon;
    data['examCount'] = examCount;
    if (exams != null) {
      data['exams'] = exams!.map((v) => v.toJson()).toList();
    }
    data['authFlag'] = authFlag;
    data['keyword'] = keyword;
    data['code'] = code;
    return data;
  }
}
